home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Satanic Rites 4
/
Satanic Rites - Issue 4 (1993-05-29)(Destiny).adf
/
Use_of_wack
/
Use_of_wack
Wrap
Text File
|
1990-01-05
|
14KB
|
329 lines
}0a000
{a-+----------------+- the ROM Kernal Manual :Exec
{a -+ {fGive it a wack{a +-
{a -+----------------+- So without further ado, here it is for
{a -+ {fAn informative{a +- those of you that don't want to buy
{a -+ {f article by {a+- the book ...
{a -+ {fTerminator {a+-
{a -+----------------+- {g ROM-WACK{a
I have noticed that in various places, {eIntroduction:{a
people have spotted strange words in
ROM such as ... Alter, set, boot etc. Wack is a keystroke-interactive bug
exterminator used with Amiga hardware
Then, someone came along and said... and software. ROM-Wack is a small,
{f"{eOh yeah, they're used by Wack - the{a ROM-resident version primarily useful
{edebugger in ROM{f"{a for system-crash data-structure
examination. ROM-Wack's command
Well, that's true, so nothing more was syntax and display formats are
said. identical to Grand-Wack of which it is
funtionally a subset. GrandWack
After a lot of searching, I managed to includes both the ROM-resident and the
find the documentation for {cROM-WACK{a in remote versions of Wack.
{eGetting to Wack{a calling the Exec Debug() function.
This is useful during the debug phase
ROM-Wack will be invoked by Exec of development for establishing
automatically upon a fatal system program breakpoints. For future
error, or it be explicity invoked compatability, Debug should be called
through the exec Debug() function. with a single null parameter -- for
Once invoked, Communication is example, Debug (0). Please note
performed through the RS232-C Serial however, that calling the Debug()
data port at 9600 baud. function does not necessarily invoke
ROM-Wack. If Grand-Wack or a user
When a fatal system error occurs, Wack supplied debugger has been installed,
can be used to examine memory in an it will be invoked in place of
attempt to locate the source of the ROM-Wack.
failure. The state of the machine
will be frozen at the point in which When Wack is called from a program,
the error occured and Wack will not system interupts continue to process,
disturb the state of system beyond but multitasking is disabled.
using a small amount of supervisor Generally this is not harmful to the
stack, memory between 200.w and 400.w system. Your graphics will still
hex and the serial data port display, keys may be typed, the mouse
can be moved, and so on. However,
A program may explicity invoke Wack by many interupts deposit raw data into
bounded or circular buffers. These Keystrokes, numbers, and symbols
ineterupts often signal related device
tasks to further process these Wack performs a function upon every
buffers. If too many ineterupts keyboard keystroke. In ROM-Wack,
occur, device buffers may begin to these functions are permanently bound
overflow or wrap around. You should to certain keys. For example, typing
limit the number of interupt actions ">" will immediately result in the
(typing keys on the Amiga keyboard for execution of the next-word function.
example) you perform while executing This type of operation gives a
in Wack. "keystroke-interactive" feel to most
of the common Wack commands.
Finally, certain system failures are
so serious that the system is forced Whenever a key is pressed, it is
to reboot. Before rebooting takes mapped through a keymap, which
place, the power LED will flash translates it into an action. A key
slowly. If you type a Del character can have different meanings in
(hex 7F) while the LED is flashing, different contexts. For simplicity,
the system will enter Wack before ROM-Wack applies keys consistently in
rebooting. all contexts (The Grand-Wack feature
of arbitrary key binding is not
available in ROM-Wack).
If a string of keys forms a number,
that number is treated as a
hexadecimal value. If a string of
keys is neither a number nor a known
symbol, the message "unknown symbol"
is presented.
During the "collection" of a symbol or
number string, typing a backspace
deletes the previous character.
Typing <CTRL-X> deletes the entire
line.
Register Frame
When Wack is invoked for any reason, a
register frame is displayed:
{c-------------------------------------------------------------------------------{a
{fROM-Wack{a
{fPC: F00AB4 SR:0000 USP: 001268 SSP:07FFE8 TRAP:0000 TASK:0008B8
DR: 00000001 00000004 0000000C 00000AB4 00000001 0000001C 00000914 00000914
SR: 00000AB4 00F0D348 00011A80 00000B9C 00F20770 00F20380 00000604
SF: 0000 00F0 0AB4 0014 00F0 0AB4 0014 00F0 0AB4 0004 00F0 0AB4 0000 0004 0000
{a This frame displays the current processor state and system context from which
you entered Wack. If you are familiar with the MC68000 processor, most of
this frame should be obvious: USP for user stack pointer, SSP for system
stack pointer e.t.c.
The TRAP field indicates the trap number the forced us into Wack. Motorola
uses the term "exceptions" for these traps. In exec, the term exception is
used for asynchronous task events. The standard TRAP numbers are
{f0 {a-{e Normal entry.
{f2 {a-{e Bus Error.
{f3 {a-{e Address Error.
{f4 {a-{e Illegal Instruction.
{f5 {a-{e Zero divide.
{f6 {a-{e CHK instruction (Should not happen).
{f7 {a-{e TRAPV instruction (should not happen).
{f8 {a-{e Privilege violation.
{f9 {a-{e Trace (Single step).
{fA {a-{e Line 1010 emulator.
{fB {a-{e Line 1111 emulator.
{f2N {a-{e Trap instruction N (2F normally for breakpoint).
{A The TASK field indicates the task from which the system entered Wack. If this
field is zero, the system entered Wack from supervisor mode.
{a The SF line provides a backtrace of the current stack frame. This is often
useful for determining the current execution context (last function called,
for example). The user stack is displayed for entry from a task; the system
stack for entry from supervisor mode. (Note: Version 25.1 always shows the
system stack, never the user stack. This will change.)
{e Display Frames{a
Wack displays memory in fixed size frames. A frame may vary in size from 0 to
64K bytes. Frames normally show addresses, word size hex data and ASCII
equivalent characters:
{f F000C4 6578 6563 2E6C 6962 7261 7279 0000 4AFC {a e x e c . l i b r a r y . . .
{f F000D4 00F0 00D2 00F0 2918 0019 0978 00F0 00C4 {a . . . . . . )^X..^Y^I x . . .
By default, Wack will pack as much memory content as it can onto a single
line. Sometimes it is preferable to see more or less than this default frame
size. The frame size may be modified with :n Here "n" represents a number of
bytes (rounded to the next unit size) that will be displayed.
{f :4
F000C4 6578 6563 e x e c
:20
F000C4 6578 6563 2E6C 6962 7261 7279 0000 4AFC {a e x e c . l i b r a r y . . .
{f F000D4 00F0 00D2 00F0 2918 0019 0978 00F0 00C4 {a. . . . . . )^X..^Y^I x . . .
A ":0" framesize is useful for altering write only custom chip registers
{eRelative Positioning{a
Wack functions as a memory editor; nearly all commands are performed relative
to your current position in memory. The following commands cause relative
movement:
{c . {g Forward a frame
{c , {g Backward a frame
{c > {g Forward a word
{c < {g Backward a word
{c +n {g Forward n bytes
{c -n {g Backward n bytes
{c <RETURN> {g Redisplay current frame
{c <SPACE> {g Foreward a word
{c <BKSP> {g Backward a word
{a An example of the use of these commands is provided below;
{c <RETURN>{a
{f F00200 7072 6573 656E 7429 0D0A 0000 2028 6372 {ap r e s e n t )^M^J ...
.
{f F00210 6173 6820 2D20 6361 6E6E 6F74 2072 6563 {aa s h - c a n n o t
,
{f F00200 7072 6573 656E 7429 0D0A 0000 2028 6372 {ap r e s e n t )^M^J ...
>
{f F00202 6573 656E 7429 0D0A 0000 2028 6372 6173 {ae s e n t )^M^J .... (
<
{f F00200 7072 6573 656E 7429 0D0A 0000 2028 6372 {ap r e s e n t )^M^J ...
+24
{f F00224 290D 0A00 2028 626F 6F74 2064 6576 6963 {a)^M^J.. ( b o o t d
-38
{f F001EC 6C65 290D 0A00 2028 6E6F 2064 6562 7567 {al e )^M^J.. ( n o d
{e Absolute Positioning{a
There are a few commands that perform absolute positioning. Typing a hex
number moves you to that position in memory:
{f 10ec
0010ec 00F0 17C0 4EF9 00F0 179A 4EF9 00F0 1786 {a....^W ..N ......^W ..
Also, Wack maintains an indirection stack to help you walk down linked lists
of absolute pointers
{f 4
000004 0000 11EC 00F0 0A8E 00F0 0A90 00F0 0A92 {a....^Q......^J......^J.....
[ (Use current longword as the next address)
{f 0011ec 0000 18F6 0000 1332 0900 00F0 086A 0000 {a....^X......^S 2^I.........
] (return to the previous "indirected" address)
{f 000004 0000 11EC 00F0 0A8E 00F0 0A90 00F0 0A92 {a....^Q......^J......^J.....
{a The find command finds a given pattern in memory, and the limit command
determines the upper bound of the search. The pattern may be from one to four
bytes in length.
The pattern is not affected by the alignment of memory; that is, byte alignment
is used for all searches regardless of the pattern size.
To set the upper bound for a find command, type and address followed by limit
or ^ The default is 1000000 hex
{e Altering Memory{a
The == command lets you modify your current memory word:
{f 20134
020134 0000 0000 0000 . . . . . . . . . . . . .
020134 0000 == 767
020134 0767 0000 0000 ^G g . . . . . . . . . .
{a If the frame size is zero, the contents of the word will not be displayed prior
to your modification of that word:
{f :0
DFF09C
DFF09C xxxx == 7FFF
{a If you decide not to modify the contents after typing a ==, press <RETURN>
without typing a number. If you have already typed a number, type <CTRL-X>.
{a The alter command performs a repeated == which is handy for setting up tables.
While in this mode the > and < will move you forward or backward one word.
To exit from this mode, type a <RETURN> with no preceding number.
{f alter
001400 0280 == 222
001402 00C8 == <
001400 0222 == 333
001402 00C8 == 444
001404 0000 == 0
001406 3700 == >
001408 0000 == 666
00140A 0000 == <RETURN>
{a You can modify registers when single-stepping or breakpointing. Typing !
followed by the register name (D0-D7,A0-A6),U) lets you make modifiactions. SR
and SSP cannot be modified.
{a The fill command fills memory with a given pattern from the current location to
an upper bound. The limit command determines the upper bound of the fill. The
size of the fill pattern determines the number of bytes the pattern occupies in
memory. For example, typing
{f fill <RETURN>
45
{a fills individual vytes with 45. Typing
{f fill <RETURN>
045
fills words, and
fill <RETURN>
0000045
fills longwords.
{c Caution:{a Using the fill command without properly setting the limiy can destroy
data in memory. To set the upper bound for a fill, type an address followed by
limit or a ^
{f Execution Control
{a These commands control program execution and system reset:
{f go {aexecute from current address
{f resume {aresume at current PC address
{f ^D {aresume at current PC address
{f ^I (TAB) {aSingle instruction step
{f boot {aReboot system (cold-reset)
{f ig {aReboot system (cold-reset)
{e Breakpoints{a
ROM-Wack has the ability to perform limited program breakpoints. Up to 16
breakpoints may be set. The breakpoint commands are as follows:
{fset {a set breakpoint at current address
{fclear {a clear breakpoint at current address
{fshow {a show all breakpoint addresses
{freset {a clear all breakpoints
To set a breakpoint, position the address pointed to the break address and type
set. Resume program execution with go or resume. When your breakpoint has been
reached, Wack will display a register frame. The breakpoint is automatically
cleared once the breakpoint is reached.
{f Returning to multitasking after a crash.{a
The user command forces the machine back into multitasking mode after a crash
that invoked ROM-Wack. This gives your system a chance to flush disk buffers
before you reset, thus securing your disks's super-structures.
Once you type `user', you cannot exit from ROM-Wack, so you should use this
command only when you want to reboot after debugging. Give your disk a few
seconds to write out it's buffers. If your machine is in serious trouble,
the user command may not work.